<template>
	<view class="identification">
		<image class="img" :src="list.result==1?'../../static/assets/img/car_success.png':'../../static/assets/img/car_fail.png'" mode=""></image>
		<view class="type" >{{list.result==1?'车牌有效':'车牌无效'}}</view>
		<view v-for="(item,i) in list.plateNo" class="carName" :key="i">
			{{item}}
		</view>
		<view class="time">{{list.scanTime}}</view>
		<view class="name">{{list.parkingName}}</view>
		
	</view>
</template>

<script>
	import util from './../../utils/util.js';
	import api from './../../utils/api.js';
	export default {
		data() {
			return {
				list:{
					
				},
				encryptedData:'',
				iv:'',
				openId:'',
				unionId:'' //二维码unionId
			}
		},
		onLoad(options){
			console.log(options)
			if(options){
				this.encryptedData=options.encryptedData
				this.iv=options.iv
				this.openId=options.openId
				this.unionId=options.unionId
			}
		},
		mounted() {
			this.getCode()
		},
		methods: {
			getCode(){
				let param={
					encryptedData:this.encryptedData,
					iv:this.iv,
					openId:this.openId,
					unionId:this.unionId
				}
				console.log(param)
				util.request(api.checkAllowed,param,'POST','application/json').then(res=>{
					if(res.success){
						this.list=res.data
						
					}else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						});
					}
				})
			}
		}
	}
</script>

<style>
@import './identification.css';
</style>
